package com.changgou.goods.dao;

import com.changgou.goods.pojo.Spec;

import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface SpecMapper extends Mapper<Spec> {

    /**
     * 根据商品分类名称查询规格列表
     * @param cateName
     * @return
     */
    @Select("select a.* from tb_spec a join tb_category b on a.template_id = b.template_id where b.name = #{name}")
    List<Spec> findByCateName(@Param("name") String cateName);
}
